package com.example.gradle_test_css.controller;

import com.evn.base.pojo.ClauseMap;
import com.evn.base.pojo.PageResult;
import com.evn.base.pojo.QueryModel;
import com.example.gradle_test_css.pojo.datainfoDTO;
import com.example.gradle_test_css.server.datainfoServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
@Controller
public class datainfoController {

    @Autowired
    private datainfoServer datainfoServer;


    @PostMapping("/getdatainfo")
    @ResponseBody
    public PageResult<datainfoDTO> datainfoList(@RequestParam(value = "page",defaultValue = "1")Integer page ,
                                                @RequestParam(value = "row",defaultValue = "5")Integer size

    ) {
        ClauseMap clauseMap = new ClauseMap();
        QueryModel queryModel = new QueryModel(clauseMap,page-1,size);

        return datainfoServer.finddatainfo(queryModel);
    }
}
